<!-- <div class="table-wrap" *ngIf="showTable">
  <table [ngStyle]="{'width': '100%'}" class="mdl-data-table mdl-js-data-table mdl-data-table--selectable mdl-shadow--2dp">
    <thead>
      <tr>
        <th class="mdl-data-table__cell--non-numeric">项目</th>
        <th class="mdl-data-table__cell--non-numeric">塔楼</th>
        <th class="mdl-data-table__cell--non-numeric">楼层</th>
        <th class="mdl-data-table__cell--non-numeric">单元</th>
        <th class="mdl-data-table__cell--non-numeric">操作</th>
      </tr>
    </thead>
    <tbody>
      <tr *ngFor="let d of Data; let i = index;">
        <td class="mdl-data-table__cell--non-numeric">{{d.project.name}}</td>
        <td class="mdl-data-table__cell--non-numeric">{{d.building.buildingAlias || d.building.buildingNumber}}</td>
        <td class="mdl-data-table__cell--non-numeric">{{d.floor.alias || d.floor.index}}</td>
        <td class="mdl-data-table__cell--non-numeric">{{d.unit.alias || d.unit.name}}</td>
        <td>
          <mdl-icon [ngStyle]="{'color': '#d4462b'}" (click)="deleteLocation(i)" class="icon material-icons" *ngIf="!IsHr">delete</mdl-icon>
        </td>
      </tr>
    </tbody>
  </table>
</div> -->

<div class="mdl-grid">
  <div class="{{static ? '' : 'mdl-cell mdl-cell--6-col'}}">
    <p class="block-title">公司位置</p>
    <div class="select-wrap" *ngIf="!IsHr">
      <!-- <div class="select-inside mdl-grid" *ngFor="let l of Data"> -->
      <mdl-select *ngIf="IsAdmin || isOpen" class="" label="选择项目" floating-label [(ngModel)]="selected.project" (change)="projectChange($event)">
        <mdl-option *ngFor="let p of projects" [value]="p.id">{{p.name}}</mdl-option>
      </mdl-select>
      <mdl-select class="" label="选择塔楼" floating-label [(ngModel)]="selected.building" (change)="buildingChange($event)">
        <mdl-option *ngFor="let p of buildings" [value]="p.id">{{p.buildingAlias || p.buildingNumber}}</mdl-option>
      </mdl-select>
      <mdl-select class="" label="选择楼层" floating-label [(ngModel)]="selected.floor" (change)="floorChange($event)">
        <mdl-option *ngFor="let p of floors" [value]="p.id">{{p.index}}</mdl-option>
      </mdl-select>
      <mdl-select class="" label="选择单元" floating-label [(ngModel)]="selected.unit" (change)="unitChange($event)">
        <mdl-option *ngFor="let p of units" [value]="p.id">{{p.name}}</mdl-option>
      </mdl-select>
      <mdl-select *ngIf="hasCompany" class="" label="选择公司" floating-label [(ngModel)]="selected.company">
        <mdl-option *ngFor="let p of companies" [value]="p.id">{{p.name}}</mdl-option>
      </mdl-select>
      <!-- </div> -->
      <div class="wrap">
        <button mdl-button *ngIf="!static" (click)="addLocation()" class="delete-item-btn ">
          <mdl-icon class="icon material-icons">playlist_add</mdl-icon>添加
        </button>
        <span *ngIf="!static">可添加多个位置</span>
      </div>
    </div>

  </div>
  <div *ngIf="!static" class="mdl-cell mdl-cell--6-col">
    <div class="demo-card-event mdl-card mdl-shadow--2dp" *ngIf="showTable">
      <div class="mdl-card__title mdl-card--expand">
        <!-- <h4>
          位置
        </h4> -->
        <div class="mdl-card__actions" *ngFor="let d of Data; let i = index;">
          <p><label>项目名称:</label>{{ d.project ? d.project.name : ''}}</p>
          <p><label>所属楼栋:</label>{{d.building ? (d.building.buildingAlias || d.building.buildingNumber) : ''}}</p>
          <p><label>楼层:</label>{{d.floor ? (d.floor.alias || d.floor.index) : ''}}</p>
          <p><label>单元:</label>{{d.unit ? (d.unit.alias || d.unit.name) : ''}}</p>
          <mdl-icon [ngStyle]="{'color': '#d4462b'}" (click)="deleteLocation(i)" class="icon material-icons" *ngIf="!IsHr">delete</mdl-icon>
        </div>
      </div>
    </div>
  </div>
  <div *ngIf="show" class="mdl-cell mdl-cell--6-col">
    <div class="demo-card-event mdl-card mdl-shadow--2dp" *ngIf="showTable">
      <div class="mdl-card__title mdl-card--expand">
        <!-- <h4>
            位置
          </h4> -->
        <div class="mdl-card__actions" *ngFor="let d of Data; let i = index;">
          <p><label>项目名称:</label>{{ d.project ? d.project.name : ''}}</p>
          <p><label>所属楼栋:</label>{{d.building ? (d.building.buildingAlias || d.building.buildingNumber) : ''}}</p>
          <p><label>楼层:</label>{{d.floor ? (d.floor.alias || d.floor.index) : ''}}</p>
          <p><label>单元:</label>{{d.unit ? (d.unit.alias || d.unit.name) : ''}}</p>
        </div>
      </div>
    </div>
  </div>

</div>